var Camera = function(eye, front, refUp, fov) {
	this.eye = eye;
	this.front = front.normalize();
	this.refUp = refUp.normalize();
	this.fov = fov;
};

Camera.prototype.initialize = function() {
	this.right = this.refUp.cross(this.front);
	this.up = this.right.cross(this.front);
	this.fovScale = Math.tan(this.fov / 2 * Math.PI / 180) * 2;
};

Camera.prototype.generateRay = function(x, y) {
	var r = this.right.multiply(x * this.fovScale);
	var u = this.up.multiply(y * this.fovScale);
	return new Ray3(this.eye, this.front.add(r).add(u).normalize());
};